﻿Imports System.Windows
Imports System.ServiceModel
Imports SharedTools
Imports ProgettoSicurezza.Client.ClientServices

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.Single)>
Public Class ClientMessagesService
    Implements IClientMessagesService



    Public Function SendPDF(p As PDFItem) As Boolean Implements IClientMessagesService.SendPDF
        Return PDFManager.PDFIncoming(p)
    End Function

    Public Function SendEncryptedPDF(p As PDFItem) As Boolean Implements IClientMessagesService.SendEncryptedPDF
        Return PDFManager.PDFIncoming(p)
    End Function


    Public Function GetUsername() As String Implements IClientMessagesService.GetUsername
        If Repository.CurrentProfile IsNot Nothing Then
            Return Repository.CurrentProfile.UserName
        Else
            Throw New Exception("Client not ready")
        End If
    End Function

    Public Function IsClientReady() As Boolean Implements IClientMessagesService.IsClientReady
        Return Repository.CurrentProfile IsNot Nothing
    End Function


End Class
